﻿<transitions:AnimatedPage 
    x:Class="SamplePhoneApp.Views.ListPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="clr-namespace:SamplePhoneApp.ViewModels" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:Controls="clr-namespace:MyToolkit.Controls;assembly=MyToolkit.Extended"
    xmlns:Paging="clr-namespace:MyToolkit.Paging;assembly=MyToolkit.Extended"
    xmlns:transitions="clr-namespace:MyToolkit.Animation.Transitions;assembly=MyToolkit.Extended"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
	Style="{StaticResource Transition}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

	<phone:PhoneApplicationPage.Resources>
		<viewModels:ListPageViewModel x:Key="viewModel" />
	</phone:PhoneApplicationPage.Resources>

	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{StaticResource viewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MYTOOLKIT SAMPLE APP" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Strings.ListPageTitle}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
		
		<Controls:NavigationList ItemsSource="{Binding Persons}" Navigate="OnEditPerson" Grid.Row="1" Margin="12,0,12,0">
			<Controls:NavigationList.ItemTemplate>
				<DataTemplate>
					<TextBlock Margin="12,0,12,12" Text="{Binding Name}" toolkit:TiltEffect.IsTiltEnabled="True"
							   TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" />
				</DataTemplate>
			</Controls:NavigationList.ItemTemplate>
		</Controls:NavigationList>
    </Grid>

	<Paging:BindableApplicationBar.ApplicationBar>
		<Paging:BindableApplicationBar IsVisible="True" IsMenuEnabled="True" DataContext="{Binding viewModel}">
			<Paging:BindableApplicationBarIconButton IconUri="/Images/AppbarNew.png" Click="OnAddPerson" 
													 Text="{Binding Strings.AppbarAdd}" />
		</Paging:BindableApplicationBar>
    </Paging:BindableApplicationBar.ApplicationBar>
</transitions:AnimatedPage>